const Koa = require("koa")
const Router = require("koa-router")

const router = new Router({ prefix: "/users" })

const app = new Koa();

// app.use((ctx, next) => {
//   console.log(ctx.request.url);
//   console.log(ctx.request.query);
//   console.log(ctx.request.params);
//   ctx.response.body = "Hello"
// })

router.get("/:id", (ctx, next) => {
  console.log(ctx.request.query);
  console.log(ctx.request.params);
})

app.use(router.routes())


app.listen(8000, () => {
  console.log("koa初体验服务器启动成功");
})